#include "Vector.h"

Vector::Vector()
{
}

Vector::~Vector()
{
}

Vector::Vector(Scalar newx, Scalar newy): x(newx), y(newy)
{
}

Vector::Vector(const Vector& rhs): x(rhs.x), y(rhs.y)
{
}
	
void Vector::SetX(Scalar newx)
{
	x = newx;
}

void Vector::SetY(Scalar newy)
{
	y = newy;
}

Scalar& Vector::GetX()
{
	return x;
}

Scalar& Vector::GetY()
{
	return y;
}

Vector Vector::GetNormal()
{
	Vector rightPerp;
	rightPerp.SetX(y);
	rightPerp.SetY(-x);
	return rightPerp;
}

Vector Vector::operator+(const Vector& rhs)
{
	Scalar sumx, sumy;
	sumx = x + rhs.x;
	sumy = y + rhs.y;
	Vector sum(sumx, sumy);
	return sum;
}